<?php
require("../config.php");
session_start();
$name = $class_go->C_title($_REQUEST['name']);
$pass = md5($class_go->C_title($_REQUEST['pass']));
if ($name!="" && $pass!="")
{
	$sqlset = $udb->sqls("select user_id from user_table where user_name='".$name."' and user_pass='".$pass."'");
	$uid = $sqlset[0]["user_id"];
	if ($uid != null)
	{
		$_SESSION["name"]=$name;
		$_SESSION["uid"]=$uid;
		echo "\n<!--Start header -->\n";
		require("../html/head.html");
		echo "\n<!--End header -->\n";
		echo "\n<!--Start Content -->\n";
		require("../html/index.html");
		echo "\n<!--End Content -->\n";
		echo "\n<!--Start Foot -->\n";
		require("../html/foot.html");
		echo "\n<!--End Foot -->\n";
	}
	else
	{
		if($_SESSION["name"]!="")
		{
			echo"<font color='red'>已经登陆！！</font>";
			echo "\n<!--Start header -->\n";
			require("../html/head.html");
			echo "\n<!--End header -->\n";
			echo "\n<!--Start Content -->\n";
			require("../html/index.html");
			echo "\n<!--End Content -->\n";
			echo "\n<!--Start Foot -->\n";
			require("../html/foot.html");
			echo "\n<!--End Foot -->\n";
		}
		else
		{
			echo"<font color='red'>用户名密码错误请重新登陆！！</font>";
			echo "\n<!--Start header -->\n";
			require("../html/head.html");
			echo "\n<!--End header -->\n";
			echo "\n<!--Start Content -->\n";
			require("../html/login.html");
			echo "\n<!--End Content -->\n";
			echo "\n<!--Start Foot -->\n";
			require("../html/foot.html");
			echo "\n<!--End Foot -->\n";
		}
	}
}

?>